home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
COMPARE.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
719b
|
23 lines
' COMPARE.BAS
' This program compares any two characters.
CLS
INPUT "Enter any character: ", firstChar$
INPUT "Enter another character: ", secondChar$
PRINT
SELECT CASE ASC(firstChar$) - ASC(secondChar$)
CASE IS < 0
PRINT "'"; firstChar$; "' comes before '"; secondChar$; "'"
PRINT "because"; ASC(firstChar$); "is less than"; ASC(secondChar$)
CASE IS > 0
PRINT "'"; firstChar$; "' comes after '"; secondChar$; "'"
PRINT "because"; ASC(firstChar$); "is more than"; ASC(secondChar$)
CASE ELSE
PRINT "'"; firstChar$; "' is the same as '"; secondChar$; "'"
PRINT "because"; ASC(firstChar$); "is equal to"; ASC(secondChar$)
END SELECT